package org.summerframework.core.util;

import org.dom4j.io.SAXReader;
import org.xml.sax.SAXException;

/**
 * @author 石超
 * @version v1.0.0
 */
public class SAXReaderUtil {
    private static final SAXReader saxReader;

    static {
        saxReader = new SAXReader();

        try {
            saxReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
            saxReader.setFeature("http://xml.org/sax/features/external-general-entities", false);
            saxReader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
            saxReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
        } catch (SAXException e) {
            e.printStackTrace();
        }
    }

    public static SAXReader getInstance() {
        return saxReader;
    }
}
